/**
 * Copyright (c) 2022 www.talkweb.com.cn Inc. AlL rights reserved.
 */
package com.sky.wsp.mybatis.plus.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sky.wsp.mybatis.plus.annotation.EncryptedColumn;
import com.sky.wsp.mybatis.plus.dao.entity.UserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

/**
 * 用户表 Mapper 接口
 *
 * @author wangshaopeng@talkweb.com.cn
 * @Date 2023-01-11
 */
@Mapper
public interface UserMapper extends BaseMapper<UserEntity> {

    /**
     * 分页
     *
     * @param query
     * @param page
     * @return
     */
    Page<UserEntity> findPage(@Param(value = "query") UserEntity query, Page<UserEntity> page);

    /**
     * 列表
     *
     * @param query
     * @return
     */
    List<UserEntity> findList(@Param(value = "query") UserEntity query);

    boolean myDeleteById(@Param(value = "id") Long id);

    UserEntity myFindById(@Param(value = "id") Serializable id);

    boolean mySave(@Param(value = "entity") UserEntity entity);

    boolean myUpdate(@Param(value = "entity") UserEntity entity);

    UserEntity selectByMobile(@EncryptedColumn @Param(value = "mobile") String mobile);
}
